package strutil

import (
	"math/rand"
)

/**
 * @desc 字符串帮助类
 * @author xu.xu
 */

const charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

func Random(length int) string {
	var builtString string
	for i := 0; i < length; i++ {
		index := rand.Intn(len(charSet))
		builtString += string(charSet[index])
	}
	return builtString
}
